<?php
App::import('Core','HttpSocket');
class NaturalLanguageComponent extends Object {
	var $yahooKey = "cmOpXZWxg64H_AQe8Mak2nHEGpAAmIRlJ6WP.i_8FsxluqC0fDvPHRnuyhyRgWPq";
	var $parseUrl = "http://jlp.yahooapis.jp/MAService/V1/parse";
	var $sock;
	function startup(&$controller){
		$this->sock = new HttpSocket();
	}
	
	function parse($params){
		$params['appid'] = $this->yahooKey;
		ksort($params);
		$response = $this->sock->get("http://jlp.yahooapis.jp/MAService/V1/parse", $params);
		return simplexml_load_string($response);
	}

}
?>